#ifndef _UART_DRIVER_H_
#define _UART_DRIVER_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"

#include "driver/uart.h"

#include "../system_Config.h"
#include "../Product_Config.h"

#define UART_NUM1          UART_NUM_1 //串口1选择
#define UART_NUM2          UART_NUM_2 //串口1选择

#define UART_BUFFER_SIZE   1024 //串口接收缓存

typedef struct 
{
    void (*uart1_func)(uart_port_t,size_t);
    void (*uart2_func)(uart_port_t,size_t);
}UART_FUNC;



void uart2_init(); //串口任务初始化
void uart1_init(); //串口任务初始化
void uart1_msg_send(uint8_t* buf,uint8_t length); //串口1发送
void uart2_msg_send(uint8_t* buf,uint8_t length); //串口2发送
void set_uart2_handle_func(void (*uart_func)(uart_port_t,size_t));
void set_uart1_handle_func(void (*uart_func)(uart_port_t,size_t));
void uart1_config(int tx_io_num, int rx_io_num,uint32_t baud_rate, bool use_ref_tick);
void uart2_config(int tx_io_num, int rx_io_num,uint32_t baud_rate, bool use_ref_tick);








#endif